<?php
/*
 * Created on 2010-9-23
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
    session_start();
    $str="0123456789abcdefghijklmnopqrstuvwxyz";
    for($i=0;$i<4;$i++)
    {
    	$k=rand(0,35);
    	$rand.=$str[$k];
    }
    $_SESSION['verify_code']=$rand;
    $img=imagecreate(80,25);
    $bg=imagecolorallocate($img,120,100,154);
    for($i=0;$i<5;$i++)
    {
        $font=imagecolorallocate($img,rand(0,255),rand(0,255),rand(0,255));
        imageline($img,rand(0,80),rand(0,25),rand(0,80),rand(0,25),$font);
    }
    for($i=0;$i<80;$i++)
    {
        $font=imagecolorallocate($img,rand(0,255),rand(0,255),rand(0,255));
        imagesetpixel($img,rand(0,80),rand(0,25),$font);
    }
    $font=imagecolorallocate($img,08,13,14);
    imagestring($img,rand(5,6),rand(3,40),rand(2,10),$rand,$font);
    header("content-type:image/jpeg");
    imagejpeg($img);
?>

